<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>咨询管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/consultation/">咨询列表</a></li>
		<shiro:hasPermission name="consultation:consultation:beautyConsultationOrder:edit"><li><a href="${ctx}/consultation/consultation/beautyConsultationOrder/form">consultation添加</a></li></shiro:hasPermission>
	</ul>
	<form:form id="searchForm" modelAttribute="beautyConsultationOrder" action="${ctx}/consultation/" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<ul class="ul-form">
			<li><label>咨询单名称：</label>
				<form:input path="remarks" htmlEscape="false" maxlength="20" class="input-medium"/>
			</li>
            <li><label>咨询项目：</label>
                <form:select path="type" class="input-xlarge">
                    <option value="">请选择</option>
                    <form:options items="${fns:getConsultationList()}" itemLabel="label" itemValue="value" htmlEscape="false"/>
                </form:select>
            </li>
            <li><label>状态：</label>
                <form:select path="status" class="input-xlarge">
                    <option value="">请选择</option>
                    <form:option value="1">启用</form:option>
                    <form:option value="0">禁用</form:option>                    
                </form:select>
            </li>



			<li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/></li>
			<li class="clearfix"></li>
		</ul>
	</form:form>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
                <th>编号</th>			
                <th>咨询单名称</th>           
                <th>咨询项目</th>			
                <th>启用日期</th>			
				<th>截止日期</th>
				<th>状态</th>
				<th>操作</th>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="beautyConsultationOrder">
			<tr>
                <td>
                    ${beautyConsultationOrder.id}
                </td>			
                <td>
                    ${beautyConsultationOrder.remarks}
                </td>
               			
                <td>

                    <c:choose>
	                    <c:when test="${beautyConsultationOrder.type== 'A'}">
	                                            美甲咨询
	                    </c:when>
	                    <c:when test="${beautyConsultationOrder.type== 'B'}">
	                                            美睫咨询
	                    </c:when>
	                    <c:when test="${beautyConsultationOrder.type== 'C'}">
	                                            纹绣咨询
	                    </c:when>
	                    <c:when test="${beautyConsultationOrder.type== 'D'}">
	                                            手足护理咨询
	                    </c:when>
	                    <c:when test="${beautyConsultationOrder.type== 'E'}">
	                                            肩颈咨询
	                    </c:when>
	                    <c:when test="${beautyConsultationOrder.type== 'F'}">
	                                            面部咨询
	                    </c:when> 
                        <c:when test="${beautyConsultationOrder.type== 'G'}">
                                                    减肥咨询
                        </c:when>	                                                                               
                    </c:choose>                     
                </td>			
	            <td>
	                <fmt:formatDate value="${beautyConsultationOrder.startDate}" pattern="yyyy-MM-dd HH:mm"/>
	            </td>			
	            <td>
	                <fmt:formatDate value="${beautyConsultationOrder.endDate}" pattern="yyyy-MM-dd HH:mm"/>
	            </td>
				<td>
                    <c:choose>
                        <c:when test="${beautyConsultationOrder.status== '1'}">
                                                启用
                        </c:when>
                        <c:when test="${beautyConsultationOrder.status== '0'}">
                                                禁用
                        </c:when>
                                                            
                    </c:choose>				

				</td>
				<td>
                    <c:choose>
                        <c:when test="${beautyConsultationOrder.status== '1'}">
                                                
                            <a href="${ctx}/consultation/updateStatus?id=${beautyConsultationOrder.id}&&status=${beautyConsultationOrder.status}" onclick="return confirmx('确认要禁用吗？', this.href)">禁用</a>                                                
                        </c:when>
                        <c:when test="${beautyConsultationOrder.status== '0'}">
                                                
                            <a href="${ctx}/consultation/updateStatus?id=${beautyConsultationOrder.id}&&status=${beautyConsultationOrder.status}" onclick="return confirmx('确认要启用吗？', this.href)">启用</a>                                                
                        </c:when>
                                                            
                    </c:choose>				
    				<a href="${ctx}/consultation/form?id=${beautyConsultationOrder.id}"> 编辑</a>
                    <a href="${ctx}/consultation/question/questionList?orderId=${beautyConsultationOrder.id}"> 题目管理</a>					
				</td>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>